package com.easypay.cn.controllers;

import com.easypay.common.Result;
import com.easypay.common.StatusCode;
import com.easypay.usercenter.api.UserServiceApi;
import com.easypay.usercenter.pojo.User;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:asheng
 * @Date: 2021/7/5 1:01 上午
 */

@RestController
public class UserCenterController {

    @DubboReference
    UserServiceApi userServiceApi;

    @GetMapping("/findAll")
    public Result findAll(){
        System.out.println("====开始调用====");
        List<User> users = userServiceApi.findAll();


        return new Result(true, StatusCode.OK,"查询成功",users);

    }


}
